public class AlievPanfilov {

	public double u = 0.0;		// @Variable ("Membrane Potential")		 
	public double v = 0.0;  	// @Variable ("Recovery")
	public double du;
	public double dv; 
	
	
	
	public double eps0 = 0.002;	// @Parameter("Fast/slow process ratio")
	public double mu1 = 0.2; 	// @Parameter("Used to control resitution") 
	public double mu2 = 0.3; 	// @Parameter("Used to control resitution") 
	public double k = 8.0;		// @Parameter
	public double a = 0.15;		// @Parameter
	
	private double eps(double u, double v) {
		return eps0 +(mu1 * v) / (u + mu2);
	}
	
	public void f(double dt, double stimulation){
		 du = -(k * u) * (u - a)* (u -1) - u * v + stimulation;
		 dv = eps(u, v) * (-v - k * u * (u - a - 1));
	}
}
